<?php

namespace App\Models\Acl;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Spatie\Permission\Traits\HasRoles;

class Staff extends Authenticatable
{
    use Notifiable, HasRoles;

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $table = 'acl_staff';

    protected $guard_name = 'admin';

    protected $hidden = [
        'password', 'remember_token',
    ];

    protected $guarded = array();

    public $timestamps = false;

    public function branch()
    {
        return $this->belongsTo('App\Models\Mgt\Branch');
    }

    public function scopeNormal($query)
    {
        return $query->where('id', '<>', ADMIN);
    }

    public function supervisor()
    {
        if ($this->id == ADMIN)
            return true;
        return false;
    }


}
